#include "PatientInformation.h"
#include "ui_PatientInformation.h"

PatientInformation::PatientInformation(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::PatientInformation)
{
    ui->setupUi(this);
}

void PatientInformation::getInformation(QString &name, QString &callNumber)
{
    name=this->ui->name->text();
    callNumber=this->ui->callNumber->text();
}

//PatientInformation::PatientInformation(Information infor,QWidget *parent) :
//    QDialog(parent),
//    ui(new Ui::PatientInformation)
//{
//    ui->setupUi(this);
//    this->ui->name->setText(infor.name);
//    this->ui->sex->setText(infor.sex);
//    this->ui->phone->setText(infor.phone);
//    this->ui->nation->setText(infor.nation);
//    this->ui->age->setText(QString::number(infor.age));
//    this->ui->birth->setText(infor.birth);
//    this->ui->blood->setText(infor.blood);
//    this->ui->id->setText(infor.id);
//    this->ui->illness->setText(infor.illness);
//    this->ui->irritability->setText(infor.irritability);
//}

PatientInformation::PatientInformation(QString name, QString sex, QString phone, QString nation,
                                       QString birth, int age,int callNumber,QString blood, QString id, QString illness,
                                       QString irritability, QWidget *parent)
{
    this->ui->name->setText(name);
    this->ui->sex->setText(sex);
    this->ui->phone->setText(phone);
    this->ui->nation->setText(nation);
    this->ui->callNumber->setText(QString::number(callNumber));
    this->ui->birth->setText(birth);
    this->ui->blood->setText(blood);
    this->ui->id->setText(id);
    this->ui->illness->setText(illness);
    this->ui->irritability->setText(irritability);
}

void PatientInformation::setUI(Information infor)
{
    this->ui->name->setText(infor.name);
    this->ui->sex->setText(infor.sex);
    this->ui->phone->setText(infor.phone);
    this->ui->nation->setText(infor.nation);
    this->ui->callNumber->setText(infor.callNumber);
    this->ui->birth->setText(infor.birth);
    this->ui->blood->setText(infor.blood);
    this->ui->id->setText(infor.id);
    this->ui->illness->setText(infor.illness);
    this->ui->irritability->setText(infor.irritability);
    this->show();
}

PatientInformation::~PatientInformation()
{
    delete ui;
}
